package com.beerandjesus.sportofkings.handicapper.dao;


import com.beerandjesus.sportofkings.handicapper.model.ProfileResult;

import java.util.Date;
import java.util.List;

public interface ProfileHistoryDAO extends AbstractDAO {

    public static final String PROFILE_HISTORY = "analysis_profile_history";
    public static final String PROFILE_HISTORY_DEF = "  (id integer unique not null, track_code varchar(6) not null, " +
            "race_date date not null, race_number integer not null, horse_name varchar(100) not null, " +
            "post_position integer, analysis_profile_type varchar(100) not null, score integer)";
    public static final String PROFILE_HISTORY_SEQUENCE = "seq_analysis_prof_hist";

    /**
     * Build (or rebuild) the profile history database from scratch
     * @throws com.beerandjesus.sportofkings.handicapper.dao.DAOException When something goes wrong
     */
    void buildDatabase() throws DAOException;

    void save(ProfileResult profileResult);

    List<ProfileResult> findByRace(String trackCode, Date raceDate, Integer raceNumber);

    List<ProfileResult> findByHorseName(String horseName);

    ProfileResult find(ProfileResult result);

    int getCount();
}
